/**
 * class: Config
 * 		- A singleton class referred by all other classes.
 * 		- It keeps all the configurations regarding the simulation.
 */

package common;

public class Config{
	// configuration
	public static final int NUMBER_OF_NODES = 25;	// # nodes to play with (for nodes)
	
	public static final int MAX_NODES = 100;		// # ip's that ip pool has (for router)
	public static final int MAX_PID = 65536;
	
	public static final int MAX_COUNTER = 250;		// 100 times * 10 ms  ==  1000 ms  ==  1 s		
	public static final int TICK_NORMAL_MS = 4;	// ms
	//public static final int TICK_NORMAL_NS = 100;	// ns
	
	public static final int RESYNC_PERIOD_S = 40;			// sec	--  for the distributed model
	public static final int RESYNC_PERIOD_CENT_S = 5;		// sec	--  for the centralized model
	public static final int RESYNC_TIMEOUT_S = 20;		// sec
	public static final int RESYNC_TOLERANCE = 5;	// times (periods)
	
	public static final int SMOOTHING_RATE = 1;			// the adjustment will be done in 1/n of RESYNC_PERIOD_S  
	
	public static final int ELECTION_TIMEOUT_S = 15;	// sec
	public static final int MIN_ELECTION_PERIOD_LOGICAL = NUMBER_OF_NODES;	// avoid the flood of ELECTION msg
	public static final int ELECTION_GIVEUP_EXPIRE_S = 120;
	
	public static final int SUBNET_SIZE = 32;
	public static final int DELAY_HOP = 4;		// = 1 tick
	
	public static final boolean VERBOSE = true;
	public static final boolean REPORT = true;
	public static final int REPORT_INTERVAL = 10;
	
	public static final int REQUEST_TIMEOUT_S = 20;		// sec
	
	public static final int ROOT_SLEEP_TIMEOUT_S = 30;	// sec
}
